import request from '@/config/axios'

// 设备实例验收单 VO
export interface DeviceInstanceAcceptanceRecordVO {
  id: number // 主键id
  deviceId: number // 设备id
  instanceId: number // 设备实例id
  acceptanceDate: Date // 验收日期
  acceptancePersonId: number // 验收人员id
  acceptanceResult: number // 验收结果（0:通过，1:不通过）
  acceptanceRemark: string // 验收备注
}

// 设备实例验收单 API
export const DeviceInstanceAcceptanceRecordApi = {
  // 查询设备实例验收单分页
  getDeviceInstanceAcceptanceRecordPage: async (params: any) => {
    return await request.get({ url: `/zjyj/device-instance-acceptance-record/page`, params })
  },

  // 查询设备实例验收单详情
  getDeviceInstanceAcceptanceRecord: async (id: number) => {
    return await request.get({ url: `/zjyj/device-instance-acceptance-record/get?id=` + id })
  },

  // 新增设备实例验收单
  createDeviceInstanceAcceptanceRecord: async (data: DeviceInstanceAcceptanceRecordVO) => {
    return await request.post({ url: `/zjyj/device-instance-acceptance-record/create`, data })
  },

  // 修改设备实例验收单
  updateDeviceInstanceAcceptanceRecord: async (data: DeviceInstanceAcceptanceRecordVO) => {
    return await request.put({ url: `/zjyj/device-instance-acceptance-record/update`, data })
  },

  // 删除设备实例验收单
  deleteDeviceInstanceAcceptanceRecord: async (id: number) => {
    return await request.delete({ url: `/zjyj/device-instance-acceptance-record/delete?id=` + id })
  },

  // 导出设备实例验收单 Excel
  exportDeviceInstanceAcceptanceRecord: async (params) => {
    return await request.download({ url: `/zjyj/device-instance-acceptance-record/export-excel`, params })
  }
}